home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- # Copyright © 2003 Colin Walters <walters@debian.org>
- # Copyright © 2006 Sjoerd Simons <sjoerd@debian.org>
-
- set -e
-
- MESSAGEUSER=messagebus
- MESSAGEHOME=/var/run/dbus
- LAUNCHER=/lib/dbus-1.0/dbus-daemon-launch-helper
-
- if [ "$1" = configure ]; then
- if [ ! -d $MESSAGEHOME ]; then
- mkdir -p $MESSAGEHOME
- fi
- adduser --system \
- --home "$MESSAGEHOME" \
- --no-create-home \
- --disabled-password \
- --group "$MESSAGEUSER"
-
- if ! dpkg-statoverride --list "$LAUNCHER" >/dev/null 2>&1; then
- chown root:"$MESSAGEUSER" "$LAUNCHER"
- chmod 4754 "$LAUNCHER"
- fi
- fi
-
- # update init script symlinks for new runlevels and priorities for upgrades
- # from older versions
- if [ "$1" = configure ] && dpkg --compare-versions "$2" lt-nl 1.1.20-1; then
- echo "Reinstalling init script for new runlevels and priorities ..." >&2
- # remove old init script symlinks; dh_installinit adds the proper
- # update-rc.d snippet later on
- update-rc.d -f dbus remove >/dev/null
- fi
-
- if [ "$1" = configure ] && [ -n "$2" ]; then
- # Do not restart dbus on upgrades, only on fresh installations.
- # (dh_installinit -r creates a start action)
- # But do reload it so the machine-id can be generated
- PID=$(status "dbus" 2>/dev/null | awk '/[0-9]$/ { print $NF }')
- if [ -n "$PID" ]; then
- # trigger an update notification which recommends to reboot
- [ -x /usr/share/update-notifier/notify-reboot-required ] && \
- /usr/share/update-notifier/notify-reboot-required || true
- dbus-uuidgen --ensure
- dbus-send --print-reply --system --type=method_call \
- --dest=org.freedesktop.DBus \
- / org.freedesktop.DBus.ReloadConfig > /dev/null
- fi
- fi
-
- # Automatically added by dh_installinit
- if [ -e "/etc/init/dbus.conf" ]; then
- # start fails if already running
- start dbus || :
- fi
- # End automatically added section
- # Automatically added by dh_installinit
- update-rc.d -f dbus remove >/dev/null || exit $?
- # End automatically added section
-
-
-